home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4263 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: dildog.lgc.com!usenet
  2. From: Glenn Carr <gcarr@tulsa.lgc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: "Initializer must be a constant expression"...?
  5. Date: Fri, 02 Feb 1996 15:22:50 -0600
  6. Organization: Landmark Graphics, Munro Garrett Products Group
  7. Message-ID: <311280AA.15FB7483@tulsa.lgc.com>
  8. NNTP-Posting-Host: aris.tulsa.lgc.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b6a (X11; I; SunOS 4.1B sun4)
  13.  
  14. We recently switched compilers from gcc to xlc on AIX and we're now getting the
  15. following compilation warnings...
  16.  
  17. "../combobox.c", line 244.10: 1506-221 (E) Initializer must be a constant expression.
  18. "../combobox.c", line 245.10: 1506-221 (E) Initializer must be a constant expression.
  19. "../combobox.c", line 246.10: 1506-221 (E) Initializer must be a constant expression.
  20.  
  21. in the following...
  22.  
  23.     typedef struct {
  24.         char          **var;
  25.         char           *descr;
  26.     } cfgStrSpec_t;
  27.  
  28.     char           *pszDepCodeSetKey = NULL;
  29.     char           *pszDepComboBox = NULL;
  30.     char           *pszShowAllIfEmpty = NULL;
  31.     cfgStrSpec_t    pCfgStr[] =
  32.     {
  33. 244:    {&pszDepCodeSetKey, "Dependent code_set_key"},
  34. 245:    {&pszDepComboBox, "Dependent widget (combobox)"},
  35. 246:    {&pszShowAllIfEmpty, "Boolean (nonzero or 0)"},
  36.         {NULL, NULL},
  37.     };
  38.  
  39. Is that not valid, or ANSI C?
  40.  
  41. --
  42. Glenn Carr, gcarr@lgc.com
  43. Landmark Graphics, MGI
  44.